// # ifndef _SIS_HPP
// # define _SIS_HPP

# include <iostream>
# include <string>
// # include <math.h>

# define SIS_AUTHOR "Dal Bo Yob"
# define SIS_PROJECT "SIS (Sis Is Sway)"
# define SIS_VERSION "v 0.0.1"

// i include this from python: 
typedef std::string str;

// word for python style as 'for (auto i in list)'
# define _in :

// convert char* to str for use concatination
// use before fisrt word (char*)
// use (_ /*words for convertaion*/).c_str () - for concatination and then convertation to char*
# define  __strup  str () +
# define  to_chars(word)  (__strup word).c_str ()

// convert chars to str, and run '__run' function
// # define  run(word)  __run(__strup word)

# define  SIS_DIR_BIN  "~/.local/sis-bin"
# define  SIS_DIR_SRC  "~/.local/sis-src"
# define  SIS_DIR_DOC  "~/.local/sis-doc"
# define  SIS_DIR_SH  "~/.local/sis-sh"
# define  SIS_DIR_LOG  "~/.local/sis/log"
# define  SIS_DIR_CONF  "~/.config/sis"
// # define  SIS_DIR_BIN  str ("~/sis/sis-bin")

# define LOG_LINK SIS_DIR_LOG + "/sis.log"



char
__run (str word)
{
  return system (to_chars (word)) / 256;
}

template<typename _word>
char
run(_word word)
{
  return __run(__strup word);
}



char
__run(str word);


// check src of sis command
bool
have_src (str sis_command);

// sis dont work without src and maybe doc
void
run_virus_only_libre (str sis_cmd);

// WHAT HAPPENING??? HOW I INIT: void error_sis (char*, char)???
// ln is crushed??? its ookey< im good, really, aaaaaa what happinig
// levels: FATAL LOG DEBUG WARNING (FAILE, ERROR, DWAWING) MESSAGE
char
error_sis (str level, str message);

// sis dont work without src and maybe doc
void
run_virus_only_libre (str sis_cmd)
{
  if (! have_src(sis_cmd))
    {
      run ("echo FATAL: source '('" + sis_cmd + "')' of command not found >> " LOG_LINK);
      run ("echo " SIS_PROJECT ": " + sis_cmd + ": source of command not found");
      run ("cat " SIS_DIR_DOC "/LAW");
      
      exit (127); // exit (EXIT_FAILURE);
    }
}

// check src of sis command
bool
have_src (str sis_source)
{
  if (run("cat " SIS_DIR_SRC "/"+sis_source + " 2> /dev/null 1> /dev/null") == 0)
    return true;
  return false;
}

// WHAT HAPPENING??? HOW I INIT: void error_sis (char*, char)???
// levels: FATAL LOG DEBUG WARNING (FAILE, ERROR, DWAWING) MESSAGE
// char
// error_sis (str level, str who, str message)
// {
  // // command have fisrt time, then level, then msg
  // str time = "`date '+[%F %T]'`";
  // return run (__strup "echo "
    // + time + " "
    // + level + ": "
    // + who + " "
    // + message + " "
    // + ">> " LOG_LINK
  // );
}

// # endif /* _SIS_HPP */

